<template>
  <div>
    <!-- 最上部 -->
    <div class="middle">
      <!-- 中间的选项 -->
      <div class="banner">
        <div class="banner-left">
          <van-image
            round
            width="1.6rem"
            height="1.6rem"
            show-loading
            :src="this.$store.state.user.pic"
            @click="$router.push('/mine/phone')"
            lazy-load
          />
          <h6 @click="$router.push('/mine/user-name')">{{ user.uname }}</h6>
        </div>

        <div class="banner-right">
          <p @click="$router.push('/mine/user-name')">编辑资料</p>
        </div>
      </div>
    </div>
    <!-- 中间选项 -->
    <div class="asset">
      <div @click="$router.push('/mine/collection')">
        <h6>收藏</h6>
        <p>收藏分类</p>
      </div>
      <span>|</span>
      <div @click="$router.push('/mine/foot-print')">
        <h6>足迹</h6>
        <p>查看足迹</p>
      </div>
      <span>|</span>
      <div @click="$router.push('/mine/praise ')">
        <h6>赞过</h6>
        <p>浏览赞过</p>
      </div>
    </div>
    <!-- 下面表单 -->
    <div class="main">
      <van-cell
        :border="false"
        title="发布的送养"
        is-link
        to="/mine/send"
        icon="shop-o"
      />

      <van-cell
        :border="false"
        title="申请的领养"
        is-link
        to="/mine/application"
        icon="send-gift-o"
      />

      <van-cell
        :border="false"
        title="购物车"
        is-link
        to="/mine/user-settings"
        icon="shopping-cart-o"
      />

      <van-cell
        :border="false"
        title="联系我们"
        is-link
        to="/mine/contact-us"
        icon="friends-o"
      />
      <span></span>
    </div>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  methods: {},
  computed: {
    //mapState将开放vuex中保存的user对象到当前组件的计算属性中
    //这样，在当前组件内部,就可以直接使用user来访问vuex中的user
    ...mapState(["user", "token"]),
  },
};
</script>

<style lang="scss" scoped>
#leg {
  width: 289px;
  height: 46px;
  display: flex;
  justify-content: space-around;
  margin: 0 auto;
  position: relative;
  bottom: 25px;
  > div {
    display: flex;

    flex-direction: column;
    &:nth-child(1) .van-icon {
      color: #ff4646;
    }
    &:nth-child(2) .van-icon {
      color: #ffb126;
    }
    &:nth-child(3) .van-icon {
      color: #5095ff;
    }
    &:nth-child(4) .van-icon {
      color: #20c79d;
    }
    > .van-icon {
      text-align: center;

      font-size: 32px;
    }
    > span {
      font-size: 14px;
      color: #666;
    }
  }
}

body,
p,
ul,
li,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

img {
  display: block;
}

* {
  box-sizing: border-box;
  color: #333;
}

html {
  font-size: 12px;
}

h1 {
  font-size: 1rem;
}

h2 {
  font-size: 1rem;
}

h3 {
  font-size: 1rem;
}

h4 {
  font-size: 1rem;
}

span,
a,
p,
strong,
i,
em {
  // font-size: 1rem;
  white-space: nowrap;
}

a {
  text-decoration: none;

  &:hover {
    cursor: pointer;
  }
}

button {
  border: none;
  background-color: transparent;
  outline: none;
  cursor: pointer;
}

input {
  outline: none;
  border: none;
}

i,
em {
  font-style: normal;
  font-weight: normal;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background-color: #b3aa94;
}

::-webkit-scrollbar-track {
  border-radius: 0;
  background-color: #ddd9cf;
}

table {
  border-collapse: collapse;
}

// 最上部
.middle {
  background-color: #ffd030;
  width: 360px;
  height: 180px;
  display: flex;
  justify-content: space-between;

  .banner {
    margin-top: 78px;
    margin-left: 30px;
    width: 390px;
    height: 58px;

    position: relative;
    overflow: hidden;
    .banner-left {
      h6 {
        font-size: 12px;
        position: absolute;
        left: 60px;
        bottom: 30px;
      }
    }
    .banner-right {
      padding: 1px;
      width: 95px;
      height: 32px;
      position: absolute;
      bottom: 15px;
      right: -12px;
      border-radius: 16px 0 0 16px;
      background-color: white;

      p {
        font-size: 0.4rem;
        text-align: center;
        line-height: 32px;
      }
    }
  }
}
// 中间选项
.asset {
  text-align: center;
  padding: 0 10px;
  position: relative;
  bottom: 30px;
  width: 328px;
  height: 62px;
  margin: 0 20px;
  border-radius: 15px;
  background-color: white;
  display: flex;
  justify-content: space-around;
  // border: 1px solid rgba(3, 3, 3, 0.1);
  box-shadow: 0 0 0 1xpx rgba(207, 203, 203, 0.2);
  div {
    padding: 5px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    p {
      font-size: 0.3rem;
      color: #666;
      margin-top: 4px;
    }
    h6 {
      font-size: 0.45rem;
    }
  }
  span {
    line-height: 62px;
    font-size: 0.8rem;
    color: #666;
    margin-left: 15px;
  }
}
// 下面表单
.main {
  position: relative;
  bottom: 20px;
  div {
    display: flex;
    text-align: center;
    i {
      margin-top: 14px;
      font-size: 20px !important;
    }
    .van-cell__left-icon {
      margin-right: 8px;
    }
    span {
      font-size: 16px !important;
      margin-top: 15px;
    }
  }
}
</style>